package ru.ksu.ktk.diploma.sdi.mapping.learner.impl;

import java.util.List;

import ru.ksu.ktk.diploma.sdi.mapping.Triple;

/**
 * element of internal classification model
 * 
 * @author coldflame 04.05.2009 23:05:57
 */
public class InternalModelElement {
    private Triple firstTriple;
    private Triple secondTriple;
    private Triple predictedProperty;
    private float propertyProbability;
    private List<ProbableDescriptorPair> descriptors;

    public static class Builder {
        private final Triple firstTriple;
        private final Triple secondTriple;
        private final Triple predictedProperty;
        private float propertyProbability;
        private List<ProbableDescriptorPair> descriptors;

        public Builder(Triple firstTriple, Triple secondTriple, Triple predictedProperty) {
            this.firstTriple = firstTriple;
            this.secondTriple = secondTriple;
            this.predictedProperty = predictedProperty;
        }

        public Builder propertyProbability(float propertyProbability) {
            this.propertyProbability = propertyProbability;
            return this;
        }

        public Builder descriptors(List<ProbableDescriptorPair> descriptors) {
            this.descriptors = descriptors;
            return this;
        }

        public InternalModelElement build() {
            return new InternalModelElement(this);
        }
    }

    private InternalModelElement(Builder builder) {
        firstTriple = builder.firstTriple;
        secondTriple = builder.secondTriple;
        predictedProperty = builder.predictedProperty;
        propertyProbability = builder.propertyProbability;
        descriptors = builder.descriptors;
    }

    public Triple getFirstTriple() {
        return firstTriple;
    }

    public void setFirstTriple(Triple firstTriple) {
        this.firstTriple = firstTriple;
    }

    public Triple getSecondTriple() {
        return secondTriple;
    }

    public void setSecondTriple(Triple secondTriple) {
        this.secondTriple = secondTriple;
    }

    public Triple getPredictedProperty() {
        return predictedProperty;
    }

    public void setPredictedProperty(Triple predictedProperty) {
        this.predictedProperty = predictedProperty;
    }

    public float getPropertyProbability() {
        return propertyProbability;
    }

    public void setPropertyProbability(float propertyProbability) {
        this.propertyProbability = propertyProbability;
    }

    public List<ProbableDescriptorPair> getDescriptors() {
        return descriptors;
    }

    public void setDescriptors(List<ProbableDescriptorPair> descriptors) {
        this.descriptors = descriptors;
    }

}
